<!--
 * @Description: 模态框
 * @Date: 2022-09-06 12:33:57
 * @LastEditTime: 2022-09-06 16:48:18
 * @FilePath: \vue3-ts-vite-pinia\src\components\Model\model.vue
-->

<template>
  <div class="model">
    <el-dialog v-model="dialogVisible" :title="title" width="30%" center :before-close="handleClose">
      <slot> </slot>
      <!-- <template #footer>
        <span class="dialog-footer">
          <el-button @click="handleClose">取消</el-button>
          <el-button type="primary" @click="handleComfirm">确定</el-button>
        </span>
      </template> -->
    </el-dialog>
  </div>
</template>

<script setup lang="ts">

interface Dialog {
  dialogVisible: boolean;
  title: string
}
const emits = defineEmits(["handleClose", "handleComfirm"])
const props = withDefaults(defineProps<Dialog>(), {
  dialogVisible: false
});
const handleClose = (val: number) => {
  emits("handleClose")
}
const handleComfirm = () => {
  emits("handleComfirm")
}
</script>

<style scoped>
</style>